#ifndef _myStuff_

#include <stdio.h>

#define DEBUG

#ifdef DEBUG
	#define _MY_PRINT_FILE printf("%s:%d: ", __FILE__, __LINE__)
	#define _MY_PRINT_LF printf("\n")
	#define _MY_PRINT_I(var1) printf("%d ", var1)
	#define _MY_PRINT_X(var1) printf("0x%x ", var1)
	#define _MY_PRINT_D(var1) printf("%f ", var1)
	#define _MY_PRINT_S(var1) printf("%s ", var1)
	#define _MY_PRINT_S_X(var1, var2) printf("%s 0x%x", var1, var2)

	#define _MY_PRINTLF_0 printf("%s:%d \n", __FILE__, __LINE__)
	#define _MY_PRINTLF_I(var1) printf("%s:%d: %d \n", __FILE__, __LINE__, var1)
	#define _MY_PRINTLF_X(var1) printf("%s:%d: 0x%x \n", __FILE__, __LINE__, var1)
	#define _MY_PRINTLF_D(var1) printf("%s:%d: %f \n", __FILE__, __LINE__, var1)
	#define _MY_PRINTLF_S(var1) printf("%s:%d: %s \n", __FILE__, __LINE__, var1)
	#define _MY_PRINTLF_S_I(var1, var2) printf("%s:%d: %s %d \n", __FILE__, __LINE__, var1, var2)
	#define _MY_PRINTLF_S_X(var1, var2) printf("%s:%d: %s 0x%x \n", __FILE__, __LINE__, var1, var2)
	#define _MY_PRINTLF_S_D(var1, var2) printf("%s:%d: %s %f \n", __FILE__, __LINE__, var1, var2)
	#define _MY_PRINTLF_S_S(var1, var2) printf("%s:%d: %s %s \n", __FILE__, __LINE__, var1, var2)
	#define _MY_PRINTLF_S_I_D(var1, var2, var3) printf("%s:%d: %s %d %f \n", __FILE__, __LINE__, var1, var2, var3)
	#define _MY_PRINTLF_S_X_D(var1, var2, var3) printf("%s:%d: %s 0x%x %f \n", __FILE__, __LINE__, var1, var2, var3)
	#define _MY_PRINTLF_S_X_X(var1, var2, var3) printf("%s:%d: %s 0x%x 0x%x \n", __FILE__, __LINE__, var1, var2, var3)
	#define _MY_PRINTLF_S_D_D(var1, var2, var3) printf("%s:%d: %s %f %f \n", __FILE__, __LINE__, var1, var2, var3)
#else
	#define _MY_PRINT_FILE
	#define _MY_PRINT_LF
	#define _MY_PRINT_I(var1) 
	#define _MY_PRINT_X(var1)
	#define _MY_PRINT_D(var1)
	#define _MY_PRINT_S(var1)
	#define _MY_PRINT_S_X(var1, var2)

	#define _MY_PRINTLF_0
	#define _MY_PRINTLF_I(var1) 
	#define _MY_PRINTLF_X(var1)
	#define _MY_PRINTLF_D(var1)
	#define _MY_PRINTLF_S(var1)
	#define _MY_PRINTLF_S_I(var1, var2)
	#define _MY_PRINTLF_S_X(var1, var2)
	#define _MY_PRINTLF_S_D(var1, var2)
	#define _MY_PRINTLF_S_S(var1, var2)
	#define _MY_PRINTLF_S_I_D(var1, var2, var3)
	#define _MY_PRINTLF_S_X_D(var1, var2, var3)	
	#define _MY_PRINTLF_S_X_X(var1, var2, var3)	
	#define _MY_PRINTLF_S_D_D(var1, var2, var3)
#endif

#define _MY_GET_UINT8_FROM_BYTE_ARRAY(arr, off) (arr[off])
#define _MY_GET_UINT16_FROM_BYTE_ARRAY(arr, off) (arr[off]<<8 | arr[off+1])
#define _MY_GET_UINT32_FROM_BYTE_ARRAY(arr, off) (arr[off]<<24 | arr[off]<<16 | arr[off]<<8 | arr[off+1])
#define _MY_GET_REAL_FROM_BYTE_ARRAY(arr, off, dataType) (*((dataType*) &(arr[off])))

#define _MY_GET_RT_TIME rt_get_cpu_time_ns()/1000000.0

#define _myStuff_
#endif
